home *** CD-ROM | disk | FTP | other *** search
- This code is provided as-is, for instructional purposes only. You may redistribute
- it or use it as you like, but by doing so you hold the authors and distributors
- harmless for any damages it may cause. This code is Copyright (c) 1994 Doug Walker,
- All Rights Reserved.
-
- Here are two functions that will mount and dismount a volume node in the DOS list,
- assigning all incoming messages to a specific port OTHER THAN the one in the Task
- structure.
-
- If you are writing a handler, this gives the following advantages:
-
- 1. No need for mountlist entries or using Mount to mount your file system.
-
- 2. You can run as a normal process instead of a Task, which means you can
- use your normal debugger, printf(), stdin, stdout, etc.
-
- The following two functions are provided:
-
- struct DeviceList *Mount(char *name, struct MsgPort *port);
-
- Mounts a volume with the given name and assigns all incoming DOS packets to
- the specified MsgPort.
-
- int DisMount(struct DeviceList *volume);
-
- Dismounts a volume, given a pointer to its volume node. Must be a volume that
- was mounted with Mount().
-
- If you have SAS/C, simply enter this directory and type "scsetup" followed by "smake"
- to compile and link the test program. This distribution consists of four files:
-
- test.c - Test program. Type "test foo" to mount a volume called "foo".
- mount.h - Prototypes for Mount() and DisMount().
- mount.c - Version of Mount() and DisMount() that works on any version of AmigaDOS
- mountv37.c - Version of Mount() and DisMount() for version 37 and up (AmigaDOS 2.0 and above)
-
- When you use smake, it links a program called "test" and one called "testv37". The latter
- is linked with mountv37.c and will only work on AmigaDOS 2.0 and above.
-
- IMPORTANT NOTE: The test program isn't designed perfectly; it's a proof-of-principle, but it
- does have some multitasking "holes" in it. Writing a good handler is left as an exercise for
- the reader 8^)
-
- Happy programming!
-
- --Doug Walker
-